/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.produccion.entity;

import java.io.Serializable;
import java.util.Date;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;
import javax.persistence.Temporal;
import javax.persistence.TemporalType;
import javax.xml.bind.annotation.XmlRootElement;

/**
 *
 * @author i5
 */
@Entity
@Table(name = "documento_detalle", catalog = "base_prod", schema = "")
@XmlRootElement
@NamedQueries({
    @NamedQuery(name = "DocumentoDetalle.findAll", query = "SELECT d FROM DocumentoDetalle d"),
    @NamedQuery(name = "DocumentoDetalle.findByIdDocumentoDetalle", query = "SELECT d FROM DocumentoDetalle d WHERE d.idDocumentoDetalle = :idDocumentoDetalle"),
    @NamedQuery(name = "DocumentoDetalle.findByCodpro", query = "SELECT d FROM DocumentoDetalle d WHERE d.codpro = :codpro"),
    @NamedQuery(name = "DocumentoDetalle.findByMovimiento", query = "SELECT d FROM DocumentoDetalle d WHERE d.movimiento = :movimiento"),
    @NamedQuery(name = "DocumentoDetalle.findByFechaMod", query = "SELECT d FROM DocumentoDetalle d WHERE d.fechaMod = :fechaMod")})
public class DocumentoDetalle implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "idDocumentoDetalle", nullable = false)
    private Integer idDocumentoDetalle;
    @Column(name = "codpro", length = 14)
    private String codpro;
    @Column(name = "Movimiento", length = 1)
    private String movimiento;
    @Column(name = "fechaMod")
    @Temporal(TemporalType.TIMESTAMP)
    private Date fechaMod;
    @JoinColumn(name = "idUsuarioMod", referencedColumnName = "idUsuario")
    @ManyToOne
    private Usuario idUsuarioMod;
    @JoinColumn(name = "idcCosto", referencedColumnName = "idcCosto")
    @ManyToOne
    private Ccosto idcCosto;
    @JoinColumn(name = "idDocumento", referencedColumnName = "idDocumento")
    @ManyToOne
    private Documento idDocumento;

    public DocumentoDetalle() {
    }

    public DocumentoDetalle(Integer idDocumentoDetalle) {
        this.idDocumentoDetalle = idDocumentoDetalle;
    }

    public Integer getIdDocumentoDetalle() {
        return idDocumentoDetalle;
    }

    public void setIdDocumentoDetalle(Integer idDocumentoDetalle) {
        this.idDocumentoDetalle = idDocumentoDetalle;
    }

    public String getCodpro() {
        return codpro;
    }

    public void setCodpro(String codpro) {
        this.codpro = codpro;
    }

    public String getMovimiento() {
        return movimiento;
    }

    public void setMovimiento(String movimiento) {
        this.movimiento = movimiento;
    }

    public Date getFechaMod() {
        return fechaMod;
    }

    public void setFechaMod(Date fechaMod) {
        this.fechaMod = fechaMod;
    }

    public Usuario getIdUsuarioMod() {
        return idUsuarioMod;
    }

    public void setIdUsuarioMod(Usuario idUsuarioMod) {
        this.idUsuarioMod = idUsuarioMod;
    }

    public Ccosto getIdcCosto() {
        return idcCosto;
    }

    public void setIdcCosto(Ccosto idcCosto) {
        this.idcCosto = idcCosto;
    }

    public Documento getIdDocumento() {
        return idDocumento;
    }

    public void setIdDocumento(Documento idDocumento) {
        this.idDocumento = idDocumento;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idDocumentoDetalle != null ? idDocumentoDetalle.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof DocumentoDetalle)) {
            return false;
        }
        DocumentoDetalle other = (DocumentoDetalle) object;
        if ((this.idDocumentoDetalle == null && other.idDocumentoDetalle != null) || (this.idDocumentoDetalle != null && !this.idDocumentoDetalle.equals(other.idDocumentoDetalle))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "com.produccion.entity.DocumentoDetalle[ idDocumentoDetalle=" + idDocumentoDetalle + " ]";
    }
    
}
